home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
icoxtr
/
form1.frm
< prev
next >
Wrap
Text File
|
1995-05-08
|
2KB
|
89 lines
VERSION 2.00
Begin Form Form1
Caption = "Extract Icon"
ClientHeight = 1095
ClientLeft = 4815
ClientTop = 3630
ClientWidth = 2670
Height = 1500
Left = 4755
LinkMode = 1 'Source
LinkTopic = "Form1"
ScaleHeight = 73
ScaleMode = 3 'Pixel
ScaleWidth = 178
Top = 3285
Width = 2790
Begin CommandButton Command2
Caption = "Exit"
Height = 372
Left = 1680
TabIndex = 2
Top = 600
Width = 852
End
Begin PictureBox IconPic
Height = 408
Left = 360
ScaleHeight = 25
ScaleMode = 3 'Pixel
ScaleWidth = 25
TabIndex = 1
Top = 528
Width = 408
End
Begin CommandButton Command1
Caption = "Do It!"
Height = 372
Left = 1680
TabIndex = 0
Top = 120
Width = 852
End
Begin VScrollBar VScroll1
Height = 852
Left = 1200
Max = 4
TabIndex = 4
Top = 120
Width = 252
End
Begin Label Label1
Alignment = 2 'Center
Caption = "Icon"
Height = 252
Left = 192
TabIndex = 3
Top = 192
Width = 732
End
End
Dim iIcon As Integer
Sub Command1_Click ()
' clear the pic
IconPic.Cls
' get the instance of the caller
hCurrentInst% = GetWindowWord(Form1.hWnd, GWW_HINSTANCE)
' extract a progman icon
hIcon% = ExtractIcon(hCurrentInst%, "progman.exe", iIcon)
' must insure this before calling DrawIcon
homap% = SetMapMode(IconPic.hDC, MM_TEXT)
' now draw it
drw% = DrawIcon(IconPic.hDC, 0, 0, hIcon%)
End Sub
Sub Command2_Click ()
Unload Form1
End Sub
Sub Form_Load ()
Label1.Caption = Label1.Caption + " #" + Str$(VScroll1.Value)
End Sub
Sub VScroll1_Change ()
iIcon = VScroll1.Value
Label1.Caption = "Icon #" + Str$(VScroll1.Value)
End Sub